<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<script type="text/javascript">
        $(function(){
            $("#orderCar_list tr:gt(0)").click(function(){
 	    	   if($(this).find(":radio").attr("checked")=="checked"){
 	    		     $(this).find(":radio").attr("checked",false);
 		    	   }else{
 		             $(this).find(":radio").attr("checked",true);
 		    	   }
            });
        });
    </script>

<div class="bjui-pageHeader" style="background:#FFF;">
		<form id="pagerForm" data-toggle="ajaxsearch" action="${ctx}/bus/userDemandRefundAction/toList" method="post">
	        <input type="hidden" name="pageSize" value="${pageResult.pageSize}">
	        <input type="hidden" name="pageCurrent" value="${pageResult.pageCurrent}">
	        <input type="hidden" name="orderField" value="${pageResult.orderField}">
	        <input type="hidden" name="orderDirection" value="${pageResult.orderDirection}">
         	<div style="margin-top: 5px;">
				<!-- 刷新按钮-->
				<button class="btn btn-orange" data-icon="refresh">刷新</button>
				<!-- 审核按钮-->
			   	<%-- <a href="${ctx}/bus/userDemandRefundAction/toFinish?id={#bjui-selected}" class="btn btn-blue" data-icon="edit" data-toggle="dialog" data-width="600" data-height="300" data-id="dialog-user" data-mask="true">审核</a> --%>
			</div>
		   	<hr style="margin-top: 5px;margin-bottom: 5px">
			<div style="margin-bottom:5px">
			<!-- 搜素功能 -->
			<label>用户姓名：<input type="text" name="paramCustomerName" value="${pageResult.ext.paramCustomerName}" placeholder="请输入客户姓名" style="width:140px;"/></label>
			<label>子订单编号：<input type="text" name="paramSubOrderNum" value="${pageResult.ext.paramSubOrderNum}" placeholder="请输入子订单编号" style="width:140px;"/></label>
			<label>
			审核类型：  <select data-toggle="selectpicker" name="paramAuditStatus">
							<option value="">全部</option>
			          <c:forEach  items= "${alertStatusTypes}" var="cu">
			            	<option value="${cu.codeValue}" ${pageResult.ext.paramAuditStatus == cu.codeValue?"selected='selected'":""}>${cu.codeName}</option>					            
		              </c:forEach>
			        </select>
			</label>
		   	<button class="btn-default" data-icon="search">查询</button>
		   	</div>
	   	</form>
	</div>

	<!-- 内容区 -->
	<div class="bjui-pageContent tableContent" id="orderCar_list">
	    <table id="doc-datagrid-table" class="table table-bordered table-hover">
	     <thead>
	    		<tr style="height:30px;">
	    			<th>状态</th>
		    		<th>子订单编号</th>
		    		<th>用户姓名</th>
		    		<th>起飞机场</th>
		    		<th>降落机场</th>
		    		<th>航班号</th>
		    		<th>申请时间</th>
		    		<th>退/改签</th>
		    		<th>审核状态</th>
	    			<th>查看详情</th>
	    		</tr>
	    	</thead> 
	    	<tbody>
	    	<c:forEach items="${pageResult.list}" var="u">
				<tr data-id="${u.id}">
					<td><input name="orderCar_radio" type="radio"  /></td>
	    			<td>${u.subOrderNum}</td>
	    			<td>${u.customerName}</td>
	    			<td>${u.originalGoUpAirport}</td>
	    			<td>${u.originalGoDownAirport}</td>
	    			<td>${u.originalGoFlightNum}</td>
	    			<td><fmt:formatDate type="both" pattern="yyyy-MM-dd HH:mm:ss" value="${u.applyTime}" /></td>
	    			<td><c:if test="${u.operationType == 1}">退票</c:if>
		    			<c:if test="${u.operationType == 2}">改签</c:if>
		    			<c:if test="${u.operationType == 3}">修改证件</c:if>
	    			</td>
	    			<td><c:if test="${u.auditStatus == 1}">审核中</c:if>
		    			<c:if test="${u.auditStatus == 2}">审核通过</c:if>
		    			<c:if test="${u.auditStatus == 3}">审核不通过</c:if>
	    			</td>
	    			<td>
	    			<c:if test="${u.auditStatus == 2 || u.auditStatus == 3}">
	    				<button type="button" class="btn btn-default" 
			    		data-toggle="dialog" 
			    		data-options="{id:'demandHandleDialog',url:'${ctx}/bus/userDemandRefundAction/toDetails',type:'post',data:{id:${u.id}}}" 
			    		data-width="900" data-height="600"
			    		data-id="dialog-user-role" 
			    		data-title="需求退改签详情">详情
			    		</button>
	    			</c:if>
	    			<c:if test="${u.auditStatus == 1}">
	    				<button type="button" class="btn btn-default" 
			    		data-toggle="dialog" 
			    		data-options="{id:'demandAuditDialog',url:'${ctx}/bus/userDemandRefundAction/toAudit',type:'post',data:{id:${u.id}}}" 
			    		data-width="900" data-height="600"
			    		data-id="dialog-user-role" 
			    		data-title="需求退改签审核">审核
			    		</button>
		    		</c:if>
    			</td>
    			</tr>
	    	</c:forEach>
	    	</tbody> 
	    </table>
	</div>
	<!-- 底部模块[如：工具条、分页组件]  -->
	<div class="bjui-pageFooter"> 
	    <div class="pages">
		    <span>每页 </span>
		    <div class="selectPagesize">
		        <select data-toggle="selectpicker" data-toggle-change="changepagesize">
		            <option value="10">10</option>
		            <option value="30">30</option>
		            <option value="60">60</option>
		            <option value="100">100</option>
		        </select>
		    </div>
		    <span> 条，共 ${pageResult.total} 条</span>
		</div>
		<div class="pagination-box" data-toggle="pagination" data-total="${pageResult.total}" data-page-size="${pageResult.pageSize}" data-page-current="${pageResult.pageCurrent}"></div>
</div>